Skip to content

fix: experiment with gcloud auth token command#4870

Merged
Ly-Joey merged 1 commit into
google:masterfrom
Ly-Joey:gcloud-auth-fix
Feb 23, 2026
Merged

fix: experiment with gcloud auth token command#4870
Ly-Joey merged 1 commit into
google:masterfrom
Ly-Joey:gcloud-auth-fix

Conversation

@Ly-Joey

@Ly-Joey Ly-Joey commented Feb 23, 2026

Copy link
Copy Markdown
Contributor

The previous way of getting access token via gcloud auth print-access-token generates a token associated with the gcloud sdk client ID. This works fine if the client credentials are synced to ADC (with gcloud auth login --update-adc)

But if we do:

gcloud auth login 
gcloud auth application-default login

The two credentials will be different, and in this case the application default credential should be used.

This PR is also trying to test if the fix will have unexpected consequences.

@Ly-Joey Ly-Joey requested a review from michaelkedar February 23, 2026 00:51
@Ly-Joey Ly-Joey merged commit 9856fa0 into google:master Feb 23, 2026
21 checks passed
@Ly-Joey Ly-Joey deleted the gcloud-auth-fix branch February 25, 2026 01:08
tymzd pushed a commit to tymzd/osv.dev that referenced this pull request Apr 13, 2026
`gcloud auth print-access-token` doesn't work if `gcloud auth
application-default login` is used because it will take the user's auth
token instead of the ADC one. This is to test if a fix will have
unanticipated consequences.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants